package com.cn.server.module.player.handler.wsPlayerHandler;

import com.cn.common.core.annotion.SocketCommand;
import com.cn.common.core.annotion.SocketModule;
import com.cn.common.core.annotion.SocketPlatform;
import com.cn.common.core.model.websocket.HttpResult;
import com.cn.common.core.session.Session;
import com.cn.common.module.ModuleId;
import com.cn.common.module.platform.PlatformType;
import com.cn.common.module.player.PlayerCmd;
import com.cn.common.module.player.request.LoginRequest;
import com.cn.common.module.player.request.RegisterRequest;
import com.cn.common.module.player.websocket.PlayerHttpResponse;

/**
 * 玩家模块
 * @author -jiawuwei-
 *
 */
@SocketPlatform(platformType = PlatformType.FROM_BROSWER)
@SocketModule(module = ModuleId.PLAYER)
public interface WSPlayerHandler {
	
	
	/**
	 * 创建并登录帐号
	 * @param channel
	 * @param data {@link RegisterRequest}
	 * @return
	 */
	@SocketCommand(cmd = PlayerCmd.REGISTER_AND_LOGIN)
	public HttpResult<PlayerHttpResponse> registerAndLogin(Session session, String data);
	

	/**
	 * 登录帐号
	 * @param channel
	 * @param data {@link LoginRequest}
	 * @return
	 */
	@SocketCommand(cmd = PlayerCmd.LOGIN)
	public HttpResult<PlayerHttpResponse>login(Session session, String data);

}
